<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Aliyun OpenService PHP SDK Document</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="../css/template.css" type="text/css"></link><script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script><script type="text/javascript" src="../js/jquery.tools.min.js"></script><script type="text/javascript" src="../js/jquery-ui-1.8.2.custom.min.js"></script><script type="text/javascript" src="../js/template.js"></script></head><body><div id="content"><h1 class="file">OSS/Models/OSSObject.php</h1><div id="file-nav-box"><div id="file-nav-options">
              Show:
              <img src="../images/icons/visibility_public.png" alt="Public" id="show-public"></img><img src="../images/icons/visibility_protected.png" alt="Protected" id="show-protected"></img><img src="../images/icons/visibility_private.png" alt="Private" id="show-private"></img><span class="attribute" id="show-inherited">inherited</span></div><div id="file-nav-container"><ul id="file-nav"><li><a href="#classes"><img src="../images/icons/class.png" alt="Class" height="14"></img>
                          Classes
                      </a><ul><li><a href="#\Aliyun\OSS\Models\OSSObject">\Aliyun\OSS\Models\OSSObject</a></li></ul></li></ul><div style="clear: left;"></div></div><div id="file-nav-tab">
              Table of Contents
          </div></div><a name="top" class="anchor"></a><div id="file-description"><div class="short-description">Copyright (C) Alibaba Cloud Computing
All rights reserved.</div><div class="long-description"><p>版权所有 （C）阿里云计算有限公司</p></div></div><a name="classes" class="anchor"></a><a id="\Aliyun\OSS\Models\OSSObject" class="anchor"></a><h2 class="class">\Aliyun\OSS\Models\OSSObject<div class="to-top"><a href="#top">jump to top</a></div></h2><div class="class"><small class="package"><b>Package: </b>Aliyun\OSS\Models</small><div class="short-description">表示OSS中的Object。
<p>
在 OSS 中，用户的每个文件都是一个 Object，每个文件需小于 5G。
Object包含key、data和user meta。其中，key是Object 的名字；
data是Object 的数据；user meta是用户对该object的描述。
</p>
<p>
Object 命名规范
<ul>
 <li>使用UTF-8编码</li>
 <li>长度必须在 1-1023字节之间</li>
 <li>不能以斜线（/）或反斜线（\）开关</li>
</ul>
</p></div><div class="long-description"></div><dl class="class-info"></dl><h3>Properties</h3><div><a id="\Aliyun\OSS\Models\OSSObject::$bucketName" class="anchor"></a><div class="property private"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_private.png" style="margin-right: 5px" alt="private"></img>string <span class="highlight">$bucketName</span></code><div class="description"><div class="short-description"><p>Object所在Bucket的名字</p>
</div></div><div class="code-tabs"><div class="long-description"></div><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>string</dd></dl></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::$key" class="anchor"></a><div class="property private"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_private.png" style="margin-right: 5px" alt="private"></img>string <span class="highlight">$key</span></code><div class="description"><div class="short-description"><p>Object的key</p>
</div></div><div class="code-tabs"><div class="long-description"></div><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>string</dd></dl></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::$metadata" class="anchor"></a><div class="property private"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_private.png" style="margin-right: 5px" alt="private"></img>array <span class="highlight">$metadata</span> = array()</code><div class="description"><div class="short-description"><p>metadata</p></div></div><div class="code-tabs"><div class="long-description"></div><strong>Default value</strong><code>array()</code><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>array</dd></dl></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::$objectContent" class="anchor"></a><div class="property private"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_private.png" style="margin-right: 5px" alt="private"></img>resource <span class="highlight">$objectContent</span> = null</code><div class="description"><div class="short-description"><p>Object的内容</p>
</div></div><div class="code-tabs"><div class="long-description"></div><strong>Default value</strong><code>null</code><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>resource</dd></dl></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::$userMetadata" class="anchor"></a><div class="property private"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_private.png" style="margin-right: 5px" alt="private"></img>array <span class="highlight">$userMetadata</span> = array()</code><div class="description"><div class="short-description"><p>用户设置的元数据</p>
</div></div><div class="code-tabs"><div class="long-description"></div><strong>Default value</strong><code>array()</code><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>array</dd></dl></div><div class="clear"></div></div></div><h3>Methods</h3><div><a id="\Aliyun\OSS\Models\OSSObject::__destruct()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">__destruct</span><span class="nb-faded-text">()</span> : void</code><div class="description"><p class="short_description">对象析构时会自动关闭流</p></div><div class="code-tabs"><div class="long-description"></div></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::__toString()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">__toString</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">以string输出Object的内容</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getBucketName()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getBucketName</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">获取Object所在Bucket的名称</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getCacheControl()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getCacheControl</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">获取返回的Cache-Control</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getContentDisposition()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getContentDisposition</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">获取返回的Content-Disposition</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getContentEncoding()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getContentEncoding</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">获取返回的Content-Encoding</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getContentLanguage()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getContentLanguage</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">获取返回的Content-Language</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getContentLength()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getContentLength</span><span class="nb-faded-text">()</span> : int</code><div class="description"><p class="short_description">获取返回内容的长度</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>int</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getContentType()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getContentType</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">获取返回的Content-Type</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getETag()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getETag</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">获取ETag</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getExpires()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getExpires</span><span class="nb-faded-text">()</span> : <a href="../files/http://php.net/manual/en/class.datetime.php">\DateTime</a> | null</code><div class="description"><p class="short_description">获取Expires</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td><a href="../files/http://php.net/manual/en/class.datetime.php">\DateTime</a> | null</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getKey()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getKey</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">获取Object的Key</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getLastModified()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getLastModified</span><span class="nb-faded-text">()</span> : <a href="../files/http://php.net/manual/en/class.datetime.php">\DateTime</a></code><div class="description"><p class="short_description">获取最后修改的日期</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td><a href="../files/http://php.net/manual/en/class.datetime.php">\DateTime</a></td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getMetadata()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getMetadata</span><span class="nb-faded-text">()</span> : array</code><div class="description"><p class="short_description">获取Object的元数据</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>array</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getObjectContent()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getObjectContent</span><span class="nb-faded-text">()</span> : resource</code><div class="description"><p class="short_description">获取Object的内容</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>resource</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Aliyun\OSS\Models\OSSObject::getUserMetadata()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getUserMetadata</span><span class="nb-faded-text">()</span> : array</code><div class="description"><p class="short_description">获取用户自定义元数据</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>array</td><td></td></tr></table></div><div class="clear"></div></div></div></div></div><small class="footer">
            Documentation was generated by
            <a href="http://phpdoc.org">phpDocumentor
                2.0.0a12</a>.
        </small></body></html>
